import http from '@/utils/http/axios';

// 通过职位参数分页获取职位数据
export function getPostListApi(params = {}) {
  return http.request({
    url: '/system/sysPosition/page',
    method: 'get',
    params,
  });
}

// 添加职位
export function addPostApi(params = {}) {
  return http.request({
    url: '/system/sysPosition',
    method: 'post',
    params,
  });
}

// 修改职位
export function modifyPostApi(params = {}) {
  return http.request({
    url: '/system/sysPosition',
    method: 'put',
    params,
  });
}

// 通过参数职位列表
export function getPostByParamsApi(params = {}) {
  return http.request({
    url: '/system/sysPosition/get',
    method: 'get',
    params,
  });
}

// 删除职位
export function deletePostApi(params) {
  return http.request({
    url: `/system/sysPosition/${params.id}`,
    method: 'delete',
  });
}

// 批量删除
export function deletePostsApi(params) {
  return http.request({
    url: `/system/sysPosition/delete`,
    method: 'delete',
    data: params,
  });
}

// 导出职位
export function exportPostApi(params) {
  return http.request({
    url: `/system/sysPosition/export`,
    method: 'delete',
    params,
    responseType: 'blob',
  });
}
